using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XSTDZ.ERP.Core.Generator;
using XSTDZ.ERP.Core.Extentions;


namespace XSTDZ.ERP.Domain.Models
{

    public partial class ReceivablePayableRecord
    {
        public ReceivablePayableRecord Init()
        {
            if (this.Id == null || this.Id.Equals(Guid.Empty))
            {
                this.Id = (Guid)new SequentialIdentityGenerator().Next;
            }
            this.CreateTime = DateTime.Now;
            this.Deleted = 0;
            return this;
        }
        public ReceivablePayableRecord Clone(ReceivablePayableRecord r)
        {
            return new ReceivablePayableRecord
            {
                BillState = r.BillState,
                Id = r.Id,
                CreateID = r.CreateID,
                CreateTime = r.CreateTime,
                Deleted = r.Deleted,
                InvoiceNO = r.InvoiceNO,
                InvoiceType = r.InvoiceType,
                IsSettle = r.IsSettle,
                MoreTaxMoney = r.MoreTaxMoney,
                OmitMoney = r.OmitMoney,
                PaidMoney = r.PaidMoney,
                PayType = r.PayType,
                ReceivablePayableBill = r.ReceivablePayableBill,
                ReceivablePayableBillID = r.ReceivablePayableBillID,
                ReceivedMoney = r.ReceivedMoney,
                ReceivedMoneyPft = r.ReceivedMoneyPft,
                Remarks = r.Remarks,
                TaxMoney = r.TaxMoney,
                UpdateDate = r.UpdateDate,
                UpdateID = r.UpdateID
            };
        }
    }
}
